package com.ryskoo.cms.noticetype.service;

import com.ryskoo.cms.noticetype.domain.NoticeTypePO;
import com.ryskoo.cms.noticetype.repository.INoticeTypeRepository;
import com.ryskoo.framework.core.service.BasicServiceImpl;
import com.ryskoo.framework.core.utils.DateFormatHelper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import javax.annotation.PostConstruct;

/**
 * @author renyuting
 * @data 2018-05-03
 */
@Service
public class NoticeTypeServiceImpl extends BasicServiceImpl<NoticeTypePO> implements INoticeTypeService{
    @Autowired
    private INoticeTypeRepository noticeTypeRepository;

    @PostConstruct
    public void init(){
        this.setDao(noticeTypeRepository);
    }

    @Override
    public void create(NoticeTypePO noticeTypePO) {
        noticeTypePO.setCreateTime(DateFormatHelper.getNowTimeStr());
        super.create(noticeTypePO);
    }
}
